import React from 'react';
import contextObj from './context';
import { useContext } from 'react'
import Grandson1 from './Grandson1';
const Son1 = () => {
    const { state, dispatch } = useContext(contextObj);
    // console.log('data', data);
    return (
        <div>
            <p onClick={() => {
                dispatch({ type: '+', payload: 5 })
            }}>子组件1--{state.count}</p>
            {/* 使用孙子1组件 */}
            <Grandson1></Grandson1>
        </div>
    );
}

export default Son1;
